package template3
{
	import flash.display.MovieClip;
	import flash.text.TextField;
	import flash.events.Event;
	import flash.text.TextFieldType;
	import flash.text.TextFormat;
	import flash.events.MouseEvent;
	
	/**
	 * ...
	 * @author sm
	 */
	public class MainScreenRussian extends MovieClip
	{
		private var bgImage:Image;	
		private var iconImage:Image;
		private var textContent:TextField;
		private var image:Image;
		private var ok:Image;
		private var cancel:Image;
		
		
		public function MainScreenRussian() 
		{
			bgImage = new Image();
			bgImage.bitmap = Icons.BACKGROUND_MAIN_RUSSIAN;
			this.addChild(bgImage);
			bgImage.x = (800 - bgImage.width) / 2;
			bgImage.y = (600 - bgImage.height) / 2;
			
			iconImage=new Image();
			iconImage.x=350;
			iconImage.y=102;
			iconImage.dimension(100,100);
			this.addChild(iconImage);
			
			textContent=new TextField();
			textContent.x=228;
			textContent.y=216;
			textContent.width=340;
			textContent.height=150;
			textContent.selectable=false;
			textContent.type=TextFieldType.DYNAMIC;
			textContent.multiline = true
			textContent.wordWrap = true;
			textContent.defaultTextFormat = new TextFormat("Ubuntu" ,14,null,null,null,null,null,null,"center");
			textContent.embedFonts=true;
			this.addChild(textContent);
			
			image=new Image();
			image.x=350;
			image.y=380;
			image.dimension(100,100);
			this.addChild(image);
			
			ok=new Image();
			ok.x=283;
			ok.y = 514;
			ok.buttonMode = true;
			ok.useHandCursor = true;
			ok.addEventListener(MouseEvent.CLICK,handleOK);
			this.addChild(ok);
			ok.bitmap=Icons.OK_RUSSIAN;
			
			cancel=new Image();
			cancel.x=417;
			cancel.y = 514;
			cancel.buttonMode = true;
			cancel.useHandCursor = true;
			cancel.addEventListener(MouseEvent.CLICK,handleCANCEL);
			this.addChild(cancel);
			cancel.bitmap=Icons.CANCEL_RUSSIAN;
		}
		public static const OK:String="ok";
		public static const CANCEL:String="cancel";
		private function handleOK(event:MouseEvent):void
		{
			dispatchEvent(new Event(OK));
		}
		
		private function handleCANCEL(event:MouseEvent):void
		{
			dispatchEvent(new Event(CANCEL));
		}
		
		public function set contentText(str:String):void
		{
			textContent.text=str;
			if (textContent.textHeight < textContent.height)
			{
				textContent.height = textContent.textHeight+5 ;
				textContent.y = 214 + (156 - textContent.height) / 2;
			}

		}
		public function set iconImageUrl(url:String):void
		{
			iconImage.url=url;
		}

		public function set imageUrl(url:String):void
		{
			image.url=url;
		}
	}

}